import { Component, OnInit } from '@angular/core';

declare var form: any;

@Component({
  templateUrl: './indexclumn.component.html'
})
export class IndexclumnComponent implements OnInit {
  fs: any = null;
  // 字典

  public dicTypeDic: any = null;
  constructor() {
    // 注册表单
    this.fs = new form.FormTreeService('indexclumn', {
      orderObject: { id: 0 },
      keyField: 'id',
      randomFields: ['id'],
      pageSize: 1000,
      defaultObject: { leaf: false }
    });
    this.fs.loadData(true);
    this.dicTypeDic = new form.DictionaryService('IndexColumnDictionaryType');
  }

  ngOnInit(): void {
  }

  checkleaf() {
    console.log( this.fs.er.dictionarytype);
    if ( this.fs.er.dictionarytype !== '1') {
      this.fs.er.leaf = true;
    } else {
      this.fs.er.leaf = false;
    }
    this.fs.save();
  }
}

